package com.citycloud.ccuap.tc.oauth2.feignclient;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.citycloud.ccuap.commons.json.JSONData;
import com.citycloud.ccuap.commons.sys.entity.SysParameter;
import com.citycloud.ccuap.commons.sys.entity.SysRole;
import com.citycloud.ccuap.commons.sys.entity.SysUser;
import com.citycloud.ccuap.config.CcuapFeignConfiguration;

@FeignClient(url = "${ccuap-sys.url}", value = "SysFeignClientService", configuration = CcuapFeignConfiguration.class)
public interface SysFCService {
	@GetMapping(value = "/v1/sys/parameter/query", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    JSONData<List<SysParameter>> getParameterList();
	
    @GetMapping(value = "/v1/oauth2/getUserInfo", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    JSONData<SysUser> findByUserNo(@RequestParam("userNo") String userNo);

    @PostMapping(value = "/v1/oauth2/getUserRoleList", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    JSONData<List<SysRole>> getUserRoleList(@RequestParam("userNo") String userNo);

    @PostMapping(value = "/v1/oauth2/updateOauth2UserSession", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    JSONData<String> updateOauth2UserSession(@RequestParam("userNo") String userNo, @RequestParam("logonIp") String logonIp);
}
